<?php
// +----------------------------
// | Created by PhpStorm
// +----------------------------
// | Author: YnnSon
// +----------------------------
namespace app\api\model;

use think\Db;

/**
 * 检车站所在地区列表
 * Class Region
 * @package app\api\model
 */
class Region extends BaseModel
{
    /**
     * @Desc 首页获取地区
     * @return bool|false|\PDOStatement|string|\think\Collection
     */
    public static function getRegion()
    {
        $ids = Db::name('company')->distinct(true)->where('is_use', '=', 1)->where('is_delete', '=', 0)->column('district');
        $ids = implode(',', $ids);
        return (new self)->field('id, name')->whereIn('id', $ids)->select();
    }
}